<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        //1、普通格式
        var p={"name":"张三","age":23,"gender":true};
        //alert(p);
        var name = p.name;
        alert(name);
        //2、{}嵌套[]
        var persons={"persons":[
                {"name":"张三","age":23,"gender":true},
                {"name":"李四","age":24,"gender":true},
                {"name":"王五","age":25,"gender":false}
            ]
        };
        //alert(persons);
        var name1 = persons.persons[1].name;
        alert(name1);
        //3、[]嵌套{}
        var person=[
            {"name":"张三","age":23,"gender":true},
            {"name":"李四","age":24,"gender":true},
            {"name":"王五","age":25,"gender":false}];
        //alert(person);
        var name2 = person[2].name;
        alert(name2);
    </script>
</head>
<body>

</body>
</html>